<#-- 首页 -->
<#include "/WEB-INF/default/fragment/nev.ftl">
<style type="text/css">
.ch-clazzlist { width: 50%; margin: 50px auto; }
.ch-clazzlist ul, .ch-clazzlist li { margin: 0px; padding: 0px; list-style: none; }
.ch-clazzlist > ul > li { width: 50%; border: 1px solid #ccc; box-sizing: border-box; position: relative; }
.ch-clazzlist > ul > li:nth-child(2n) { border-left: none; }
/*.ch-clazzlist > ul > li:nth-child(2n+1):after { content: '+'; position: absolute; right: 0px; bottom: 0px; }*/
.ch-clazzlist > ul > li:nth-child(n+3) { border-top: none; }
.ch-clazzlist > ul > li:last-child { border-right: 1px solid #ccc; }
.ch-clazzlist-item { display: block; padding: 10px;  }
.ch-clazzlist-item:hover .ch-clazzlist-item-team > a { color: #d00e31; }
.ch-clazzlist-item-manager { color: #999; margin-top: 10px; }
.ch-clazzlist-item-team > label { font-size: 12px; }
</style>
<div>
    <div id="main">
        <div align="center"><img src="./assets/image/logo.png" alt=""></div>
    </div>
    <div class="ch-clazzlist">
        <ul class="clearfix">

        </ul>
    </div>
</div>
<script id="index_team_item" type="text/tms-template">
    <li class="fl">
        <div class="ch-clazzlist-item" data-startat="">
            <div class="ch-clazzlist-item-team clearfix">
                <a class="fl" href="{{subdomain}}">{{name}}</a>
                <label class="fr">2017-03-28</label>
            </div>
            <div class="ch-clazzlist-item-manager" href="">{{desc}}</div>
            <div class="ch-clazzlist-item-process"></div>
        </div>
    </li>
</script>
<script>
  (function(){
    $.getJSON('${request.contextPath}/team-list.action', {}, function(json, textStatus) {
              var html = $('#index_team_item').html();
              for(var i in json){
                $('.ch-clazzlist > ul').append(parse(html,json[i]));
              }
              //用正则表达式去解析模板
              function parse(html,data){
                    var str = html;
                    for(var i in data){
                        str = str.replace('{{'+i+'}}',data[i]);
                    }
                    return str;
              }
        });
  })();

</script>
<#include "/WEB-INF/default/fragment/footer.ftl">